package cn.explink.dop.distributor.condition;

import java.util.List;

import cn.explink.distributor.framework.Condition;
import cn.explink.distributor.framework.enums.ConditionTypeEnum;

public class HavingDeliveryMan extends MatchableCondition {

	private static final long serialVersionUID = 3750690103474017457L;
	// 店面可能有多个配送人员
	private List<String> deleveryManIdList;

	public HavingDeliveryMan() {
		this.setType(ConditionTypeEnum.Matchable.getValue());
	}

	@Override
	public boolean isMatched(Condition condition) {
		for (String deliveryManId_storefront : this.deleveryManIdList) {
			for (String deliveryManId : ((HavingDeliveryMan) condition)
					.getDeleveryManIdList()) {
				if (deliveryManId_storefront.equals(deliveryManId)) {
					return true;
				}
			}
		}
		return false;
	}

	public List<String> getDeleveryManIdList() {
		return deleveryManIdList;
	}

	public void setDeleveryManIdList(List<String> deleveryManIdList) {
		this.deleveryManIdList = deleveryManIdList;
	}

}
